package com.htthorizon.neo4j.repository;

import com.htthorizon.neo4j.entity.BD;
import com.htthorizon.neo4j.entity.Model;
import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface BDRepository extends Neo4jRepository<BD, Long> {

    @Query("MATCH (d:BD) WHERE d.name CONTAINS $name RETURN d")
    List<Model> findByName(@Param("name") String name);
}
